<!Doctype html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
		<title>css滚动条样式</title>
		<style type="text/css">
			.box {
				width: 600px;
				height: 400px;
				margin: 100px auto;
				border: 1px solid #000;
				border-right: 0;
			}

			.main {
				overflow-x: hidden;
				overflow-y: auto;
				color: #000;
				font-size: 16px;
				height: 100%;
			}

			.main p {
				height: 300px;
			}

			/*-------滚动条整体样式----*/
			.main::-webkit-scrollbar {
				width: 8px;
				height: 8px;
			}

			/*滚动条里面小方块样式*/
			.main::-webkit-scrollbar-thumb {
				border-radius: 100px;
				-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
				background: blue;
			}

			/*滚动条里面轨道样式*/
			.main::-webkit-scrollbar-track {
				-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
				border-radius: 0;
				background: rgba(0, 0, 0, 0.1);
			}
		</style>
	</head>
	<body>
		<div class="box">
			<div class="main">
				<p>内容1</p>
				<p>内容2</p>
				<p>内容3</p>
			</div>
		</div>
	</body>
</html>
